////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_INTERLOCKED_H__
#define __WN_INTERLOCKED_H__

#include "WNCore/inc/WNBase.h"

__WN_INLINE WN_ATOM_T WNInterlockedCompareSwap(volatile WN_ATOM_T* _destination, WN_ATOM_T _swap, WN_ATOM_T _compare);
__WN_INLINE WN_VOID* WNInterlockedCompareSwapPointer(WN_VOID* volatile* _destination, WN_VOID* _swap, WN_VOID* _compare);
__WN_INLINE WN_BOOL WNInterlockedDoubleCompareSwap(volatile WN_ATOM_T* _destination, WN_ATOM_T* _swap, WN_ATOM_T* _compare);
__WN_INLINE WN_ATOM_T WNInterlockedSwap(volatile WN_ATOM_T* _target, WN_ATOM_T _value);
__WN_INLINE WN_VOID* WNInterlockedSwapPointer(WN_VOID* volatile* _target, WN_VOID* _value);
__WN_INLINE WN_ATOM_T WNInterlockedIncrement(volatile WN_ATOM_T* _value);
__WN_INLINE WN_ATOM_T WNInterlockedDecrement(volatile WN_ATOM_T* _value);

#include "WNConcurrency/inc/WNInterlocked.inl"

#endif // __WN_INTERLOCKED_H__